/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/




#if !defined(AFX_PGLPIEDATA_H__DDA14775_DDAE_4E42_AA02_612426DCFE36__INCLUDED_)
#define AFX_PGLPIEDATA_H__DDA14775_DDAE_4E42_AA02_612426DCFE36__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLObject.h>

/*! \brief Pie data.

\ingroup PGLPieGroup
*/
class PGLCORE_EXT_CLASS CPGLPieData : public CPGLObject  
{
PGL_DECLARE_DYNCREATE(CPGLPieData);
public:
	//! \name Constructor
	//@{
	//! Construtor with data...
	CPGLPieData(double dValue = 1, bool bExploded = false);
	//! Copy constructor
	CPGLPieData(const CPGLPieData& p){*this = p;};
	//! Assignement constructor
	CPGLPieData& operator = (const CPGLPieData& p);
	//! Desctructor
	~CPGLPieData(){};
	//@}
	
	//!\name Setters and Getters
	//@{
	//! Returns value of data
	double GetValue() const					{	return m_dValue;};
	//! Pie is a little bit out of the center
	bool IsExploded() const					{	return m_bExploded;};
	//! Sets the value
	void SetValue(double dVal)					{	m_dValue = __max(m_dValue,0);};
	//! sets exploded state
	void SetExploded(bool bExplodedTrue = true) {	m_bExploded = bExplodedTrue;};
	//@}

	//! \a	name Serialiation and debugging
	//@{
	void SerializeXML(CPGLArchive& ar);
    #ifdef _DEBUG
        virtual void Dump( CDumpContext& dc ) const;
        virtual void AssertValid() const;    // Override
    #endif
    //@}

protected:
	//! \name Attributes
	//@{
	//! Value
	double m_dValue;
	//! Exploded state
	bool m_bExploded;
	//@}
};

PGL_DECLARE_SMARTPTR( CPGLPieData );

/*! CPGLPieDataList

  List of handle to CPGLPieData

\ingroup PGLPieGroup
*/
typedef std::list<CPGLPieDataPtr> CPGLPieDataList;

#endif // !defined(AFX_PGLPIEDATA_H__DDA14775_DDAE_4E42_AA02_612426DCFE36__INCLUDED_)
